package com.sample.service.scheduling;

import org.springframework.scheduling.quartz.CronTriggerBean;
import org.springframework.scheduling.quartz.JobDetailBean;

import java.text.ParseException;

/**
 * User: khanhpham
 * Date: 10/26/11
 */
public class CronTriggerFactory {

   public static CronTriggerBean createCronTriggerBean(final String cronExpression, final String triggerName,
                                                JobDetailBean jobDetail) throws ParseException {
      CronTriggerBean cronTriggerBean = null;
      cronTriggerBean = new CronTriggerBean();
      cronTriggerBean.setCronExpression(cronExpression);
      cronTriggerBean.setName(triggerName);
      cronTriggerBean.setJobDetail(jobDetail);

      return cronTriggerBean;
   }
}
